#include"IntervalTree.h"

int main(int argc, char* argv[])
{
    class IntervalTree A;
    //insert 10 interval to A;
    A.interval_insert(16.2, 25.1);
    A.interval_insert(8.4, 9.2);
    A.interval_insert(15, 24.2);
    A.interval_insert(5.1, 8.1);
    A.interval_insert(0, 3.2);
    A.interval_insert(6.3, 10.2);
    A.interval_insert(25.1, 30.1);
    A.interval_insert(17.2, 19.2);
    A.interval_insert(26.2, 26.5);
    A.interval_insert(19.2, 20.1);
    //test the max of root
    std::cout << "the max of the root: " << A.getroot()->max << std::endl;
    //find the interval (5.3, 6.2)
    std::cout << "the result of search interval(5.3, 6.2): (" << A.interval_search(5.3, 6.2)->interval.low;
    std::cout << " ," << A.interval_search(5.3, 6.2)->interval.high << ")\n";
    return 0;
}